import { createApp } from 'vue'
import router from './router/index.js'
import store from './store/index.js'
import App from './App.vue'

// 导入Mock模拟请求
import './_mock/index.js'

// 全量引入 element-ui plus
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
// 全量引入 element-ui plus 图标库
import * as ElIconModules from '@element-plus/icons-vue'
import zhCN from 'element-plus/es/locale/lang/zh-cn'

// 引入window事件监听管理文件
import './_util/window-event-listen.js'

// 引入权限指令
import permissionDirective from './_directive/permission-directive.js'

const app = createApp(App)
app.use(router)
app.use(store)
app.use(ElementPlus, { locale: zhCN })
for (let iconName in ElIconModules) {
    app.component(iconName, ElIconModules[iconName])
}
app.directive('permission', permissionDirective)

app.mount('#app')